<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

class Classify extends Model
{
    //
    use SoftDelete;

    public function lifes($data)
    {
        $validate = new \app\common\validate\Classify();
        if (!$validate->check($data)){
            return $validate -> getError();
        }
        $cla = $this -> find($data['id']);
        $cla -> content = $data['content'];
        $result = $cla -> save();
        if ($result){
            return 1;
        } else {
            return '更新成功！';
        }
    }
}
